package com.info33.platform.system.dto;

import com.info33.platform.system.entity.SysDeptPost;
import com.info33.platform.system.entity.SysUser;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 系统 - 用户 - 登录信息
 *
 * @author admin
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SysUserDTO extends SysUser {

    private static final long serialVersionUID = 1L;

    @Valid
    @ApiModelProperty(value = "租户入参")
    private SysTenantDTO sysTenantDTO;

    @NotNull(groups = {SysUserDTO.MessageLogin.class,
            SysUserDTO.ChangePasswordByCode.class,
            SysUserDTO.ForgetPassword.class}, message = "验证码不能为空")
    @ApiModelProperty(value = "验证码")
    private Integer code;

    @NotBlank(groups = {ChangePassword.class}, message = "旧密码不能为空")
    @ApiModelProperty(value = "旧密码")
    private String oldPassWord;

    @NotBlank(groups = {ForgetPassword.class}, message = "确认密码不能为空")
    @ApiModelProperty(value = "确认密码")
    private String confirmPassword;

    @ApiModelProperty(value = "部门信息")
    private SysDeptDTO deptDTO;

    @ApiModelProperty(value = "岗位信息")
    private SysPostDTO postDTO;

    @NotNull(groups = {SysUserDTO.UpdateUser.class}, message = "租户用户信息不能为空")
    @ApiModelProperty(value = "租户用户信息")
    private SysTenantUserDTO tenantUserDTO;

    @NotEmpty(groups = {SaveUser.class, UpdateUser.class}, message = "部门岗位不能为空")
    @ApiModelProperty(value = "部门岗位")
    private List<SysDeptPost> sysDeptPostList;

    @Valid
    @ApiModelProperty(value = "用户拓展信息")
    private SysUserProfileDTO userProfileDTO;

    @ApiModelProperty(value = "用户类型")
    private String userType;

    @ApiModelProperty(value = "创建人id集合")
    private List<Long> createByList;

    public interface PasswordLogin {
    }

    public interface MessageLogin {
    }

    public interface MessagePush {
    }

    public interface SaveUser {
    }

    public interface UpdateUser {
    }

    public interface ChangePassword {
    }

    public interface AppPassWordLogin {
    }

    public interface AppChange {
    }

    public interface AppCheckLoginName {
    }

    public interface ChangePasswordByCode {
    }

    public interface ForgetPassword {
    }
}